<div id="main_content">
    <h3><?php echo $title ?></h3>
    <div class="form_search wrapSalaryInfo">
        <table class="full">
            <tr>
                <td >
                    <form>
                        <label><?php echo $lblemployeeName; ?>: </label> <label><a class="useritem user" title="<?php echo dQuotes($employeeName); ?>" href="<?php echo base_url('/employee/update'); ?>"><?php echo subString($employeeName, 20); ?></a></label>
                        <a data-SalaryInfoId="0" href="<?php echo base_url('/employee/salary-info/update'); ?>" class="register"><?php echo $lblnewRegister; ?></a>
                    </form>
                </td>
            </tr>
        </table>
    </div> 
    <div class="table_list">
        <table width="500" border="0"  class="list_view_data salaryinfo" cellpadding="0" cellspacing="0">
            <tr align="center">
                <th><?php echo $lblOrder; ?></th>
                <th><?php echo $lblGrossSalary; ?></th>
                <th><?php echo $lblApplyDate; ?></th>
                <th><?php echo $lblEdit; ?></th>
                <th><?php echo $lblActive; ?></th>
            </tr>
            <?php if ($data): ?>
                <?php foreach ($data as $item): ?>
                    <tr>
                        <td align="center"><?php echo ++$order; ?></td>
                        <td align="center"><div class="table_col"><?php echo $item->GrossSalary; ?></div></td>
                        <td align="center"><?php echo date('Y/m', strtotime($item->ApplyDate)); ?></td>
                        <td align="center" width="70">
                            <div class="table_col">
                                <a href="<?php echo base_url('/employee/salary-info/update'); ?>" data-SalaryInfoId="<?php echo $item->SalaryInfoId; ?>">
                                    <img src="<?php echo base_url('/public/sites/images/Pencil.png'); ?>" width="15">
                                </a>
                            </div>
                        </td>
                        <td align="center" width="70"><div class="table_col table_col_status">
                                <img src="<?php echo ($item->Del_Flag) ? base_url('/public/sites/images/uncheck.gif') : base_url('/public/sites/images/check-icon.png'); ?>" width="15">
                            </div>
                        </td>
                    </tr> 
                <?php endforeach; ?>
            <?php endif; ?>
        </table>
        <?php if (!$data): ?>
            <div class="clr"></div>
            <div class="errormessage"><?php echo $message; ?></div>
        <?php endif ?>
    </div>
    <div class="clr"></div>
    <div class="pagination"><?php echo $pagi; ?></div>
</div>
<div class="redirectTo">
    <form class="frmRedirectTo" class="frmRedirectTo" name="frmRedirectTo" action="" method="POST">
        <input type="hidden" name="txtEmployeeId" class="employeeID" value="<?php echo $employeeID; ?>">
        <input type="hidden" name="txtSalaryInfoId" class="salaryInfoId" value="0">
    </form>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $('.pagination a, a.useritem.user').click(function(e) {
            e.preventDefault();
            var url = $(this).attr('href');
            if (url != 'javascript:void(0)') {
                $('.frmRedirectTo').attr('action', url);
                $('.frmRedirectTo').submit();
            }
        });
        $('.table_col a, a.register').click(function(e) {
            e.preventDefault();
            var url = $(this).attr('href');
            var salaryInfoId = $(this).attr('data-SalaryInfoId');
            $('.frmRedirectTo').attr('action', url);
            $('.salaryInfoId').val(salaryInfoId);
            $('.frmRedirectTo').submit();
        });
    });
</script>